<template>
  <div class="test">
    <button @click="isOk = !isOk">isOk</button>
    <my-li v-if="isOk">isOk</my-li>

    <button @click="isShow = !isShow">isOk</button>
    <keep-alive>
      <my-li v-if="isShow">isShow</my-li>
    </keep-alive>
  </div>

</template>
<script>
  import MyLi from  './li'
  export default {
    data() {
      return {
        isOk: true,
        isShow:true
      };
    },
    components: {
      'my-li':MyLi
    }
  }
</script>
